<?php
error_reporting(E_ERROR);
$url = 'http://rogovdata.cloudapp.net:8080/v1/RoGovOpenData/Posturi?$select=tip&format=json';

	$return = array();
  $ch = curl_init();
  $timeout = 5;
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
  $data = curl_exec($ch);
  curl_close($ch);
  
  
  $data_array = json_decode($data,true);

  foreach($data_array[d] as $linie)
  if(!in_array($linie[tip],$return))
  	$return[] =  $linie[tip];

	echo json_encode($return);
	
	?>
